<template>
  <div id="app">
    <input type="text" v-model="inputValue" class="ipt">
    <button @click="add" class="btn">添加</button><br>
    <button class="item">{{name}}</button>
  </div>
</template>
<script>
  export default {
    data(){
      return{
        name:"",
         inputValue:""
      }
    },
    methods:{
      add:function(){
          this.name=this.inputValue
      }
    }
  }
</script>
<style scoped>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

nav {
  padding: 30px;
}

nav a {
  font-weight: bold;
  color: #2c3e50;
}

nav a.router-link-exact-active {
  color: #42b983;
}

.ipt{
  height: 40px;
  outline: none;
}
.btn{
  height: 40px;
  background: #40b883;
  color: white;
  margin-bottom: 20px;
}
.item{
  width: 200px;
  height: 40px;
  line-height: 40px;
  background: #40b883;
  color: white;
  border-bottom: 1px solid #ccc;
  margin: 0 auto;
}
</style>
